<input type="hidden" id="{$preffix}-direction" name="direction" value="{$direction}">
<input type="hidden" id="{$preffix}-order" name="order" value="{$order}">
<table id="{$preffix}-tablecol" class="tablesorter" border=0 cellpadding=0 cellspacing=1 align="center">
	<thead>
		<tr>
			{foreach from=$columns key='label' item='column' name="cols"}
				<th onclick="change_order('{$preffix}','{$label}','{$column.order}');">
					{$column.label}
					{if $order==$label}
						{if "ASC"==$direction}
							<img src="{$DOC_ROOT}modules/dec/static/images/report/desc.gif">
						{else}
							<img src="{$DOC_ROOT}modules/dec/static/images/report/asc.gif">
						{/if}
					{else}
						<img src="{$DOC_ROOT}modules/dec/static/images/report/bg.gif">
					{/if}
				</th>
			{/foreach}
		</tr>
	</thead>
	<tbody class="middle">
		{foreach from=$data item='records' name='records'}
			<tr onclick="swap_background(this)">
				{foreach from=$records item='record' name="cols"}
					<td class="{if $smarty.foreach.cols.first}first{else}{if $smarty.foreach.cols.last}last{else}center{/if}{/if}">
						{if $smarty.foreach.cols.first && sizeof($actions)}
						<input type="checkbox" name="{$preffix}-report_actions[]" value="{$record}">
						{/if}
						{$record}
					</td>
				{/foreach}
			</tr>
		{foreachelse}
			<tr>
				<td colspan="{$smarty.foreach.cols.total}">{__ t='No Record Found'}</td>
			</tr>
		{/foreach}
	</tbody>
	<tfoot class='last_row'>
		{if !empty($last_row) && $smarty.foreach.records.total != 0}
			<tr>
				{foreach from=$columns key='label' item='column'}
					{if array_key_exists($label, $last_row) eq true}
						<td>{$last_row.$label}</td>
					{else}
						<td class="last_row_null"></td>
					{/if}
				{/foreach}
			</tr>
		{/if}
		{if sizeof($actions)}
			<tr>
				<td colspan="{$smarty.foreach.cols.total}" class="report-actions">
					<input type="checkbox" id="{$preffix}-report_checkall" onclick="report_check_all('{$preffix}');">
					<label>{__ t='With Checked: '}</label>
					<select name="report_action" id="{$preffix}-action" onchange="javascript: eval(this.value+'\(\'{$preffix}\'\)');">
						<option value="">...</option>
						{html_options options=$actions}
					</select>
				</td>
			</tr>
		{/if}
	</tfoot>		
</table>
{if isset($show_pagination) && true==$show_pagination}{$pagination}{/if}